<template>
	<uv-tabbar :value="tabValue" activeColor="red">
		<uv-tabbar-item text="首页" icon="home" @click="changePage(0)"></uv-tabbar-item>
		<uv-tabbar-item text="订单" icon="order" @click="changePage(1)"></uv-tabbar-item>
		<uv-tabbar-item text="收益" icon="calendar" @click="changePage(2)"></uv-tabbar-item>
		<uv-tabbar-item text="我的" icon="account" @click="changePage(3)"></uv-tabbar-item>
	</uv-tabbar>
</template>

<script setup>
	import {
		ref
	} from 'vue'
	
	import {
		navigate
	} from '@/util/tools.js';
	
	const props = defineProps({
	  tabValue: {
	    type: Number,
	    default: 0
	  }
	})
	
	const changePage = (index) => {
		if (props.tabValue === index) {
			return
		}
		if (index === 0) {
			navigate('/pages-skilled/index')
		}
		if (index === 1) {
			navigate('/pages-skilled/order')
		}
		if (index === 2) {
			navigate('/pages-skilled/income/income')
		}
		if (index === 3) {
			navigate('/pages-skilled/my/my')
		}
	}
</script>

<style>
</style>